/*
 * Copyright (c) 2015-2018 Sfkj Science And Technology Co.,Ltd.
 * All Rights Reserved.
 * This software is the confidential and proprietary information of
 * Sfkj Science And Technology Co.,Ltd.
 * ("Confidential Information").You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Sfkj.
 */
package com.sfkj.walk.api.activity;

import com.sfkj.walk.axon.web.AbstractCommandGatewayController;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.axonframework.commandhandling.TargetAggregateIdentifier;
import org.axonframework.domain.DateTimeRange;
import org.axonframework.domain.ImageUrl;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import static com.sfkj.walk.axon.web.WebContants.API_PREFIX;
import static com.sfkj.walk.axon.web.WebContants.MY_PREFIX;

@Data
@EqualsAndHashCode(callSuper = false)
@RestController
@RequestMapping(MY_PREFIX + "/activity/create")
public class CreateActivityCommand extends AbstractCommandGatewayController<CreateActivityCommand> implements java.io.Serializable {

    private static final long serialVersionUID = -6248477467977470424L;

    @TargetAggregateIdentifier
    @NotNull
    private String id;
    @NotNull
    private ActivityType activityType;
    @NotBlank
    private String title;
    private String introduction;
    private ImageUrl coverUrl;
    @NotNull
    @Valid
    private DateTimeRange time;

}